"""
@Author    : ghenyar
@Time      : 2025/8/28 12:55
@File      : __init__
@Desc      : Celery+Rabbitmq分布式任务
"""
from celery import Celery

celery_app = Celery(
    "tasks",
    broker="amqp://guest:guest@localhost:5672//",
    backend="rpc://",
    include=["app.celerys.order"]  # 包含任务模块
)


@celery_app.on_after_configure.connect
def setup_orm(sender, **kwargs):
    # 连接数据库连接池
    print("启动分布式任务")

